package com.itheima.a02mycharstream;

import java.io.FileReader;
import java.io.IOException;

public class FileReaderDemo2 {
    public static void main(String[] args) throws IOException {
        //带参数的字符流read方法

        FileReader fr=new FileReader("myio\\a.txt");

        char[] buf=new char[2];

        int i;
        while ((i = fr.read(buf))!=-1){
            System.out.print(new String(buf, 0, i));
        }
    }
}
